package com.lagou.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author
 */
@Component
public class HostConfig implements InitializingBean {

    @Value("127.0.0.1")
    private String host;

    @Value("8880")
    private int port;

    private String addr;

    @Override
    public void afterPropertiesSet() throws Exception {
        this.addr = host + ":" + port;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }
}
